package com.springcloud3.service;

import com.springcloud3.event.LoginSuccessEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
public class SysServrice {
    @EventListener
    public void onEvent(LoginSuccessEvent event){
        System.out.println("~~~~SysServrice~~~~"+event);
        recordLog(event.getSource().toString());
    }

    public void recordLog(String userName){
        System.out.println(userName+ "一条日志");
    }
}
